\(\int \frac {\sin ^2(a+\sqrt {-\frac {1}{n^2}} \log (c x^n))}{x^3} \, dx\) [39]

   Optimal result
   Rubi [A] (verified)
   Mathematica [F]
   Maple [A] (verified)
   Fricas [C] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 25, antiderivative size = 76 \[ \int \frac {\sin ^2\left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right )}{x^3} \, dx=-\frac {1}{4 x^2}+\frac {e^{2 a \sqrt {-\frac {1}{n^2}} n} \left (c x^n\right )^{-2/n}}{16 x^2}-\frac {e^{-2 a \sqrt {-\frac {1}{n^2}} n} \left (c x^n\right )^{2/n} \log (x)}{4 x^2} \]

[Out]

-1/4/x^2+1/16*exp(2*a*n*(-1/n^2)^(1/2))/x^2/((c*x^n)^(2/n))-1/4*(c*x^n)^(2/n)*ln(x)/exp(2*a*n*(-1/n^2)^(1/2))/
x^2

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.080, Rules used = {4581, 4577} \[ \int \frac {\sin ^2\left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right )}{x^3} \, dx=\frac {e^{2 a \sqrt {-\frac {1}{n^2}} n} \left (c x^n\right )^{-2/n}}{16 x^2}-\frac {e^{-2 a \sqrt {-\frac {1}{n^2}} n} \log (x) \left (c x^n\right )^{2/n}}{4 x^2}-\frac {1}{4 x^2} \]

[In]

Int[Sin[a + Sqrt[-n^(-2)]*Log[c*x^n]]^2/x^3,x]

[Out]

-1/4*1/x^2 + E^(2*a*Sqrt[-n^(-2)]*n)/(16*x^2*(c*x^n)^(2/n)) - ((c*x^n)^(2/n)*Log[x])/(4*E^(2*a*Sqrt[-n^(-2)]*n
)*x^2)

Rule 4577

Int[((e_.)*(x_))^(m_.)*Sin[((a_.) + Log[x_]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Dist[(m + 1)^p/(2^p*b^p*d^p*p^p)
, Int[ExpandIntegrand[(e*x)^m*(E^(a*b*d^2*(p/(m + 1)))/x^((m + 1)/p) - x^((m + 1)/p)/E^(a*b*d^2*(p/(m + 1))))^
p, x], x], x] /; FreeQ[{a, b, d, e, m}, x] && IGtQ[p, 0] && EqQ[b^2*d^2*p^2 + (m + 1)^2, 0]

Rule 4581

Int[((e_.)*(x_))^(m_.)*Sin[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(d_.)]^(p_.), x_Symbol] :> Dist[(e*x)^(m + 1)
/(e*n*(c*x^n)^((m + 1)/n)), Subst[Int[x^((m + 1)/n - 1)*Sin[d*(a + b*Log[x])]^p, x], x, c*x^n], x] /; FreeQ[{a
, b, c, d, e, m, n, p}, x] && (NeQ[c, 1] || NeQ[n, 1])

Rubi steps \begin{align*} \text {integral}& = \frac {\left (c x^n\right )^{2/n} \text {Subst}\left (\int x^{-1-\frac {2}{n}} \sin ^2\left (a+\sqrt {-\frac {1}{n^2}} \log (x)\right ) \, dx,x,c x^n\right )}{n x^2} \\ & = -\frac {\left (c x^n\right )^{2/n} \text {Subst}\left (\int \left (\frac {e^{-2 a \sqrt {-\frac {1}{n^2}} n}}{x}-2 x^{-\frac {2+n}{n}}+e^{2 a \sqrt {-\frac {1}{n^2}} n} x^{-\frac {4+n}{n}}\right ) \, dx,x,c x^n\right )}{4 n x^2} \\ & = -\frac {1}{4 x^2}+\frac {e^{2 a \sqrt {-\frac {1}{n^2}} n} \left (c x^n\right )^{-2/n}}{16 x^2}-\frac {e^{-2 a \sqrt {-\frac {1}{n^2}} n} \left (c x^n\right )^{2/n} \log (x)}{4 x^2} \\ \end{align*}

Mathematica [F]

\[ \int \frac {\sin ^2\left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right )}{x^3} \, dx=\int \frac {\sin ^2\left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right )}{x^3} \, dx \]

[In]

Integrate[Sin[a + Sqrt[-n^(-2)]*Log[c*x^n]]^2/x^3,x]

[Out]

Integrate[Sin[a + Sqrt[-n^(-2)]*Log[c*x^n]]^2/x^3, x]

Maple [A] (verified)

Time = 21.96 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.05

method result size
parallelrisch \(\frac {\left (n -2 \ln \left (c \,x^{n}\right )\right ) \cos \left (2 \ln \left (c \,x^{n}\right ) \sqrt {-\frac {1}{n^{2}}}+2 a \right )+2 \sqrt {-\frac {1}{n^{2}}}\, \ln \left (c \,x^{n}\right ) n \sin \left (2 \ln \left (c \,x^{n}\right ) \sqrt {-\frac {1}{n^{2}}}+2 a \right )-2 n}{8 x^{2} n}\) \(80\)

[In]

int(sin(a+ln(c*x^n)*(-1/n^2)^(1/2))^2/x^3,x,method=_RETURNVERBOSE)

[Out]

1/8*((n-2*ln(c*x^n))*cos(2*ln(c*x^n)*(-1/n^2)^(1/2)+2*a)+2*(-1/n^2)^(1/2)*ln(c*x^n)*n*sin(2*ln(c*x^n)*(-1/n^2)
^(1/2)+2*a)-2*n)/x^2/n

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.24 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.86 \[ \int \frac {\sin ^2\left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right )}{x^3} \, dx=-\frac {{\left (4 \, x^{4} \log \left (x\right ) + 4 \, x^{2} e^{\left (\frac {2 \, {\left (i \, a n - \log \left (c\right )\right )}}{n}\right )} - e^{\left (\frac {4 \, {\left (i \, a n - \log \left (c\right )\right )}}{n}\right )}\right )} e^{\left (-\frac {2 \, {\left (i \, a n - \log \left (c\right )\right )}}{n}\right )}}{16 \, x^{4}} \]

[In]

integrate(sin(a+log(c*x^n)*(-1/n^2)^(1/2))^2/x^3,x, algorithm="fricas")

[Out]

-1/16*(4*x^4*log(x) + 4*x^2*e^(2*(I*a*n - log(c))/n) - e^(4*(I*a*n - log(c))/n))*e^(-2*(I*a*n - log(c))/n)/x^4

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 219 vs. \(2 (70) = 140\).

Time = 5.36 (sec) , antiderivative size = 219, normalized size of antiderivative = 2.88 \[ \int \frac {\sin ^2\left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right )}{x^3} \, dx=\frac {3 n \sqrt {- \frac {1}{n^{2}}} \sin {\left (a + \sqrt {- \frac {1}{n^{2}}} \log {\left (c x^{n} \right )} \right )} \cos {\left (a + \sqrt {- \frac {1}{n^{2}}} \log {\left (c x^{n} \right )} \right )}}{4 x^{2}} + \frac {\sqrt {- \frac {1}{n^{2}}} \log {\left (c x^{n} \right )} \sin {\left (a + \sqrt {- \frac {1}{n^{2}}} \log {\left (c x^{n} \right )} \right )} \cos {\left (a + \sqrt {- \frac {1}{n^{2}}} \log {\left (c x^{n} \right )} \right )}}{2 x^{2}} - \frac {\cos ^{2}{\left (a + \sqrt {- \frac {1}{n^{2}}} \log {\left (c x^{n} \right )} \right )}}{2 x^{2}} + \frac {\log {\left (c x^{n} \right )} \sin ^{2}{\left (a + \sqrt {- \frac {1}{n^{2}}} \log {\left (c x^{n} \right )} \right )}}{4 n x^{2}} - \frac {\log {\left (c x^{n} \right )} \cos ^{2}{\left (a + \sqrt {- \frac {1}{n^{2}}} \log {\left (c x^{n} \right )} \right )}}{4 n x^{2}} \]

[In]

integrate(sin(a+ln(c*x**n)*(-1/n**2)**(1/2))**2/x**3,x)

[Out]

3*n*sqrt(-1/n**2)*sin(a + sqrt(-1/n**2)*log(c*x**n))*cos(a + sqrt(-1/n**2)*log(c*x**n))/(4*x**2) + sqrt(-1/n**
2)*log(c*x**n)*sin(a + sqrt(-1/n**2)*log(c*x**n))*cos(a + sqrt(-1/n**2)*log(c*x**n))/(2*x**2) - cos(a + sqrt(-
1/n**2)*log(c*x**n))**2/(2*x**2) + log(c*x**n)*sin(a + sqrt(-1/n**2)*log(c*x**n))**2/(4*n*x**2) - log(c*x**n)*
cos(a + sqrt(-1/n**2)*log(c*x**n))**2/(4*n*x**2)

Maxima [A] (verification not implemented)

none

Time = 0.22 (sec) , antiderivative size = 54, normalized size of antiderivative = 0.71 \[ \int \frac {\sin ^2\left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right )}{x^3} \, dx=-\frac {4 \, c^{\frac {4}{n}} x^{6} \cos \left (2 \, a\right ) \log \left (x\right ) + 4 \, c^{\frac {2}{n}} x^{4} - x^{2} \cos \left (2 \, a\right )}{16 \, c^{\frac {2}{n}} x^{6}} \]

[In]

integrate(sin(a+log(c*x^n)*(-1/n^2)^(1/2))^2/x^3,x, algorithm="maxima")

[Out]

-1/16*(4*c^(4/n)*x^6*cos(2*a)*log(x) + 4*c^(2/n)*x^4 - x^2*cos(2*a))/(c^(2/n)*x^6)

Giac [F]

\[ \int \frac {\sin ^2\left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right )}{x^3} \, dx=\int { \frac {\sin \left (\sqrt {-\frac {1}{n^{2}}} \log \left (c x^{n}\right ) + a\right )^{2}}{x^{3}} \,d x } \]

[In]

integrate(sin(a+log(c*x^n)*(-1/n^2)^(1/2))^2/x^3,x, algorithm="giac")

[Out]

integrate(sin(sqrt(-1/n^2)*log(c*x^n) + a)^2/x^3, x)

Mupad [F(-1)]

Timed out. \[ \int \frac {\sin ^2\left (a+\sqrt {-\frac {1}{n^2}} \log \left (c x^n\right )\right )}{x^3} \, dx=\int \frac {{\sin \left (a+\ln \left (c\,x^n\right )\,\sqrt {-\frac {1}{n^2}}\right )}^2}{x^3} \,d x \]

[In]

int(sin(a + log(c*x^n)*(-1/n^2)^(1/2))^2/x^3,x)

[Out]

int(sin(a + log(c*x^n)*(-1/n^2)^(1/2))^2/x^3, x)